package com.ruoyi.ldzlsb.domain;

import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 巡检计划对象 sb_inspection_plan
 * 
 * @author anli
 * @date 2025-01-11
 */
public class SbInspectionPlan extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 计划ID */
    private Long planId;

    /** 计划编号 */
    @Excel(name = "计划编号")
    private String planCode;

    // 默认构造函数
    public SbInspectionPlan()
    {
    }

    public SbInspectionPlan(String planCode)
    {
        this.planCode = planCode;
    }

    public SbInspectionPlan(Long planId)
    {
        this.planId = planId;
    }

    /** 计划名称 */
    @Excel(name = "计划名称")
    private String planName;

    /** 巡检配置ID */
    @Excel(name = "巡检配置ID")
    private Long configId;
    
    /** 设备类型ID - 兼容旧版本API */
    private Long typeId;

    /** 巡检配置名称 */
    @Excel(name = "巡检配置名称")
    private String configName;
    
    /** 巡检配置对象 */
    private SbInspectionConfig config;
    
    /** 设备ID */
    @Excel(name = "设备ID")
    private Long equipmentId;

    /** 设备名称 */
    @Excel(name = "设备名称")
    private String equipmentName;
    
    /** 设备对象 */
    private SbEquipment equipment;

    /** 巡检周期类型（1每天 2每周 3每月 4每季度 5每年） */
    @Excel(name = "巡检周期类型", readConverterExp = "1=每天,2=每周,3=每月,4=每季度,5=每年")
    private String cycleType;

    /** 巡检周期值 - 兼容旧版本API */
    private Integer cycleValue;

    /** 巡检日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "巡检日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date inspectionDate;

    /** 计划开始日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startDate;

    /** 计划结束日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endDate;

    /** 巡检人员ID */
    private Long inspectorId;

    /** 巡检人员名称 */
    @Excel(name = "巡检人员")
    private String inspectorName;

    /** 负责部门ID */
    private Long deptId;
    
    /** 负责部门名称 */
    @Excel(name = "负责部门")
    private String deptName;

    /** 状态（0停用 1启用） */
    @Excel(name = "状态", readConverterExp = "0=停用,1=启用")
    private String status;

    /** 删除标志（0代表存在 1代表删除） */
    private String isDelete;

    /** 是否自动生成巡检单（0否 1是） */
    @Excel(name = "是否自动生成巡检单", readConverterExp = "0=否,1=是")
    private String autoGenerate;
    
    /** 下次巡检日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "下次巡检日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date nextInspectionDate;
    
    /** 已生成的巡检单 */
    private List<SbInspectionRecord> inspectionRecords;

    /** 备注 */
    private String remark;
    
    /** 周期配置JSON数据 */
    private String cycleConfigJson;

    public void setCycleConfigJson(String cycleConfigJson)
    {
        this.cycleConfigJson = cycleConfigJson;
    }

    public String getCycleConfigJson()
    {
        return cycleConfigJson;
    }

    public void setPlanId(Long planId) 
    {
        this.planId = planId;
    }

    public Long getPlanId() 
    {
        return planId;
    }

    public void setPlanCode(String planCode) 
    {
        this.planCode = planCode;
    }

    public String getPlanCode() 
    {
        return planCode;
    }

    public void setPlanName(String planName) 
    {
        this.planName = planName;
    }

    public String getPlanName() 
    {
        return planName;
    }

    public void setConfigId(Long configId) 
    {
        this.configId = configId;
    }

    public Long getConfigId() 
    {
        return configId;
    }
    
    public void setTypeId(Long typeId)
    {
        this.typeId = typeId;
    }
    
    public Long getTypeId()
    {
        return typeId;
    }
    
    public void setConfigName(String configName) 
    {
        this.configName = configName;
    }

    public String getConfigName() 
    {
        return configName;
    }
    
    public SbInspectionConfig getConfig() {
        return config;
    }
    
    public void setConfig(SbInspectionConfig config) {
        this.config = config;
    }
    
    public void setEquipmentId(Long equipmentId) 
    {
        this.equipmentId = equipmentId;
    }

    public Long getEquipmentId() 
    {
        return equipmentId;
    }

    public void setEquipmentName(String equipmentName) 
    {
        this.equipmentName = equipmentName;
    }

    public String getEquipmentName() 
    {
        return equipmentName;
    }
    
    public SbEquipment getEquipment() {
        return equipment;
    }
    
    public void setEquipment(SbEquipment equipment) {
        this.equipment = equipment;
    }

    public void setCycleType(String cycleType) 
    {
        this.cycleType = cycleType;
    }

    public String getCycleType() 
    {
        return cycleType;
    }
    
    public void setCycleValue(Integer cycleValue)
    {
        this.cycleValue = cycleValue;
    }
    
    public Integer getCycleValue()
    {
        return cycleValue;
    }
    
    public Date getInspectionDate() {
        return inspectionDate;
    }
    
    public void setInspectionDate(Date inspectionDate) {
        this.inspectionDate = inspectionDate;
    }

    public void setStartDate(Date startDate) 
    {
        this.startDate = startDate;
    }

    public Date getStartDate() 
    {
        return startDate;
    }

    public void setEndDate(Date endDate) 
    {
        this.endDate = endDate;
    }

    public Date getEndDate() 
    {
        return endDate;
    }

    public void setInspectorId(Long inspectorId) 
    {
        this.inspectorId = inspectorId;
    }

    public Long getInspectorId() 
    {
        return inspectorId;
    }

    public void setInspectorName(String inspectorName) 
    {
        this.inspectorName = inspectorName;
    }

    public String getInspectorName() 
    {
        return inspectorName;
    }
    
    public Long getDeptId() {
        return deptId;
    }
    
    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }
    
    public String getDeptName() {
        return deptName;
    }
    
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    public void setIsDelete(String isDelete) 
    {
        this.isDelete = isDelete;
    }

    public String getIsDelete() 
    {
        return isDelete;
    }

    public String getAutoGenerate() {
        return autoGenerate;
    }

    public void setAutoGenerate(String autoGenerate) {
        this.autoGenerate = autoGenerate;
    }
    
    public Date getNextInspectionDate() {
        return nextInspectionDate;
    }
    
    public void setNextInspectionDate(Date nextInspectionDate) {
        this.nextInspectionDate = nextInspectionDate;
    }
    
    public List<SbInspectionRecord> getInspectionRecords() {
        return inspectionRecords;
    }
    
    public void setInspectionRecords(List<SbInspectionRecord> inspectionRecords) {
        this.inspectionRecords = inspectionRecords;
    }

    @Override
    public String toString() {
        return "SbInspectionPlan{" +
                "planId=" + planId +
                ", planCode='" + planCode + '\'' +
                ", planName='" + planName + '\'' +
                ", configId=" + configId +
                ", configName='" + configName + '\'' +
                ", config=" + config +
                ", typeId=" + typeId +
                ", equipmentId=" + equipmentId +
                ", equipmentName='" + equipmentName + '\'' +
                ", equipment=" + equipment +
                ", cycleType='" + cycleType + '\'' +
                ", cycleValue=" + cycleValue +
                ", inspectionDate=" + inspectionDate +
                ", startDate=" + startDate +
                ", endDate=" + endDate +
                ", inspectorId=" + inspectorId +
                ", inspectorName='" + inspectorName + '\'' +
                ", deptId=" + deptId +
                ", deptName='" + deptName + '\'' +
                ", status='" + status + '\'' +
                ", isDelete='" + isDelete + '\'' +
                ", autoGenerate='" + autoGenerate + '\'' +
                ", nextInspectionDate=" + nextInspectionDate +
                ", inspectionRecords=" + inspectionRecords +
                '}';
    }
} 